﻿function setSessionStorage(key, val) {
    sessionStorage.setItem(key, JSON.stringify(val));
}

function getSessionStorageVal(key) {
    var retVal = null;
    var val = sessionStorage.getItem(key);
    if ((val != null) && (val.length > 0)&&(val!="undefined")) {
        retVal = JSON.parse(val);
    }
    return retVal;
}

function removeSessionStorage(key) {
    sessionStorage.removeItem(key);
}

function setLocaleStorage(key, val) {
    localStorage.setItem(key, JSON.stringify(val));
}

function getLocaleStorageVal(key) {
    var retVal = null;
    var val = localStorage.getItem(key);
    if ((val != null) && (val.length > 0)) {
        retVal = JSON.parse(val);
    }
    return retVal;
}

function removeLocaleStorage(key) {
    localStorage.removeItem(key);
}

function setStorage(key, val) {
    setSessionStorage(key, val);
}

function getStorageVal(key) {
    return getSessionStorageVal(key);
}

function removeStorage(key) {
    removeSessionStorage(key);
}